From: Florian Müllner Date: Wed, 25 Feb 2015 19:26:08 +0000 (+0100) Subject: dateMenu: Use formatTime() for world clock X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~1580 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=39fd7b9a05a75dabd19628ab1ac4afe007404bb5;p=gnome-shell.git dateMenu: Use formatTime() for world clock https://bugzilla.gnome.org/show_bug.cgi?id=745111 --- diff --git a/js/ui/dateMenu.js b/js/ui/dateMenu.js index 76d66fcc3..cd77c41be 100644 --- a/js/ui/dateMenu.js +++ b/js/ui/dateMenu.js @@ -200,23 +200,11 @@ const WorldClocksSection = new Lang.Class({ }, _updateLabels: function() { - let desktopSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.interface' }); - let clockFormat = desktopSettings.get_string('clock-format'); - let hasAmPm = new Date().toLocaleFormat('%p') != ''; - - let format; - if (clockFormat == '24h' || !hasAmPm) - /* Translators: Time in 24h format */ - format = N_("%H\u2236%M"); - else - /* Translators: Time in 12h format */ - format = N_("%l\u2236%M %p"); - for (let i = 0; i < this._locations.length; i++) { let l = this._locations[i]; let tz = GLib.TimeZone.new(l.location.get_timezone().get_tzid()); let now = GLib.DateTime.new_now(tz); - l.actor.text = now.format(format); + l.actor.text = Util.formatTime(now, { timeOnly: true }); } } });